package com.biom3d.dashboard;

import com.biom3d.R;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.net.Uri;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class AboutActivity extends Activity {

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.dashboard_about_layout);
		
		DisplayMetrics dm = new DisplayMetrics();
        getWindowManager().getDefaultDisplay().getMetrics(dm);
        if(dm.widthPixels < 600) {
        	setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        }

		// PET-SI button
		Button btn_openWebsite = (Button) findViewById(R.id.btn_openWebsite);

		btn_openWebsite.setOnClickListener(new OnClickListener() {
			public void onClick(View arg) {
				Intent viewIntent = new Intent("android.intent.action.VIEW",
						Uri.parse("http://www.petsi.facom.ufu.br/"));
				startActivity(viewIntent);
			}
		});
	}
}